<template>
  <div class="list full-screen">
    <nav-bar>
      <span slot="text">{{ category_name }}</span>
    </nav-bar>
    <div class="container my-position">
      <shop-list :shop="shopList" />
    </div>
    <div class="text my-center" v-if="!shopList.length">
      暂无店铺
    </div>
  </div>
</template>

<script>
import { getShopCategory } from '@/network/getData';

import ShopList from '@/components/content/shoplist/ShopList';

export default {
  data() {
    return {
      category_id: null,
      category_name: '',
      shopList: []
    };
  },
  created() {
    this.category_id = this.$route.query.id;
    this.category_name = this.$route.query.name;
  },
  mounted() {
    getShopCategory(this.category_id).then(res => {
      this.shopList = res.data;
    });
  },
  components: { ShopList }
};
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  overflow: hidden;
}
</style>
